/*
 * Copyright (C) 2009-2010 adrian_007, adrian-007 on o2 point pl
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef MANAGER_H
#define MANAGER_H

#include "stdinc.h"
#include "SettingsPage.h"
class Manager {
public:
	Manager(HINSTANCE hInstance);
	~Manager(void);

private:
	static WTW_PTR convert(WTW_PARAM wParam, WTW_PARAM lParam, void* ptr);
	static WTW_PTR startBot(WTW_PARAM wParam, WTW_PARAM lParam, void* ptr);
	static WTW_PTR stopBot(WTW_PARAM wParam, WTW_PARAM lParam, void* ptr);
	static WTW_PTR showSettingPage(WTW_PARAM wParam, WTW_PARAM lParam, void* ptr);
	void initOptions();
	void initSettings();
	void initStartActions();
	void initStopAction();
	std::wstring retrieveResponse(wtwMessageDef* message);
	void handleBotAction(wtwMenuItemDef* menuItem, wtwMenuPopupInfo* menuInfo);
	static WTW_PTR AutoResponse(WTW_PARAM wParam, WTW_PARAM lParam, void* ptr);
	static WTW_PTR sendMessage(WTW_PARAM wParam, WTW_PARAM lParam, void* ptr);
	static wchar_t* getMsgContext(wtwMessageDef *msg, std::string humour);
	static wchar_t* getDayPeriod(time_t time);
	HINSTANCE hInstance;
	HANDLE chatHook;
	void* config;
	wtwOptionPageDef settings;
	std::string humour;
};

#endif
